// pages/classify/classify.js
const app = getApp();
import http from "../../utils/http";
import util from "../../utils/util";
import Dialog from "@vant/weapp/dialog/dialog";
Page({
	data: {
		checked: false, // 是否同意协议
	},

	onChange(event) {
		this.setData({
			checked: event.detail,
		});
	},
	// 提交订单
	submitOrder() {
		if (!this.data.checked) {
			wx.showToast({
				title: "请先阅读并同意协议",
				icon: "none",
			});
			return;
		}

		// wx.showToast({
		// 	title: "订单提交成功",
		// 	icon: "success",
		// });
	},
	cancelOrder() {
		Dialog.confirm({
			title: "取消确认",
			message: "订单还未付款,确认要取消吗?",
			cancelButtonText: "再考虑下",
			confirmButtonText: "取消订单",
		})
			.then(() => {
				// on confirm
				console.log("确认");
			})
			.catch(() => {
				// on cancel
				console.log("取消");
			});
	},
	handleCancel() {
		Dialog.confirm({
			message: "当前订单暂不支持在线申请退款,如需退款,请联系门店",
			cancelButtonText: "取消",
			confirmButtonText: "联系门店",
		})
			.then(() => {
				// on confirm
				console.log("确认");
			})
			.catch(() => {
				// on cancel
				console.log("取消");
			});
	},
});
